<?php
if (isset($_GET['classid'])) {
    echo CHtml::link('Back To Manage Class', array('classes/admin'));
    if (isset($model->classes->class_titile))
        echo '<h3>Query(s) For Class ::' . $model->classes->class_titile . '.</h3>';
}
if (isset($_GET['courseid'])) {
    echo CHtml::link('Back To Manage Course', array('courses/admin'));
    if (isset($model->courses->course_titile))
        echo '<h3>Query(s) For Course ::' . $model->courses->course_titile . '.</h3>';
}
?>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'make-query-grid',
    'dataProvider' => $model->search(),
    'columns' => array(
        'query',
        'name',
        array(
            'name' => 'users_id',
            'header' => 'Query By',
            'value' => 'GxHtml::valueEx($data->users)',
            'filter' => GxHtml::listDataEx(Users::model()->findAllAttributes(null, true)),
        ),
        array(
            'name' => 'is_converted',
            'type' => 'raw',
            'value' => '$data->is_converted==null ? "No" : "Yes"',
            'filter' => array('is NULL' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),
        ),
        array(
            'name' => 'mail_sent',
            'type' => 'raw',
            'value' => '$data->mail_sent==null ? "No" : "Yes"',
            'filter' => array('is NULL' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),
        ),
    ),
));
?>
<style>
    .row-fluid .span9 {
        width: 95%;
        margin: 0 auto;
    }</style>